<template>
  <div class="returnBack">
    <el-dialog
      title="退回"
      :visible.sync="returnBackDlgVisible"
      :destroy-on-close="true"
      width="50%"
      :before-close="handleClose"
    >
      <el-card>
        <el-form ref="form" :model="rbform" label-width="80px">
          <el-form-item label="退回目标">
            <el-select v-model="rbform.rbTarget" placeholder="请选择退回目标">
              <el-option label="申请方" value="1"></el-option>
              <el-option :disabled="fzOption" label="分诊中心" value="2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="退回原因">
            <el-select v-model="rbform.rbReason" placeholder="请选择退回原因">
              <el-option label="患者资料不全" value="患者资料不全"></el-option>
              <el-option label="会诊原因不详" value="会诊原因不详"></el-option>
              <el-option label="其他" value="其他"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="备注">
            <el-input type="textarea" v-model="rbform.rbRemarks"></el-input>
          </el-form-item>
        </el-form>
      </el-card>
      <span slot="footer" class="dialog-footer">
        <span v-if="rbform.rbTarget == 1" class="tips">提示：会诊申请单，确定退回后可在申请方的申请暂存修改重新提交</span>
        <span v-if="rbform.rbTarget == 2" class="tips">提示：会诊申请单，确定退回后可在前质控列表查看</span>
        <el-button @click="handleCancel">取 消</el-button>
        <el-button type="primary" @click="handleConfirm">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    returnBackDlgVisible: {
      type: Boolean,
      default: false
    },
    fzOption: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      rbform: {
        rbTarget: '1',
        rbReason: '患者资料不全',
        rbRemarks: ''
      }
    }
  },
  methods: {
    handleClose() {
      this.$emit('getRbCancel')
    },
    handleCancel() {
      this.$emit('getRbCancel')
    },
    handleConfirm() {
      const that = this
      this.$emit('getRbConfirm', that.rbform)
    }
  }
}
</script>

<style lang="scss" scoped>
.tips {
  font-size: 12px;
  color: #999;
  margin-right: 20px;
}
</style>
